import 'dart:ui';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:liuxlcommon/view/lxl_widget.dart';
import 'package:liuxlcommon/view/my_style.dart';

class BaseColumn extends StatelessWidget {
  double? height;
  List<Widget> children;

  LStyle lStyle;
  BaseColumn({required this.children, this.height,required this.lStyle});

  static double paddingHeight = 0;

  static init() {
    if (paddingHeight == 0 || Get.statusBarHeight == 0) {
      paddingHeight = Get.statusBarHeight + kToolbarHeight;
    }
  }

  @override
  Widget build(BuildContext context) {
    if(paddingHeight==0) {
      paddingHeight=MediaQueryData.fromWindow(window).padding.top+kToolbarHeight;
    }
    return SingleChildScrollView(
        child: SizedBox(
      height: height ?? Get.height - paddingHeight,
      child:  LColumn(
        lStyle: lStyle,
        children: children,
      ),
    ));
  }
}
